package 面试;

public class Equals比较 {
    public static void main(String[] args) {
        Integer a = 1;
        Integer b = 2;/**装箱  Integer b = Integer.valueOf(2); **/
        Integer f = 3;

        int num1 = 1;
        int num2 = 2;
        Long c = 1L;/**装箱 Long c = Long.valueOf(1L); **/
        Long d = 2L;
        /**equals对比需要将传入的参数进行装箱操作**/
        System.out.println(b.equals(d));/** 装箱后类的类型都不对，为false **/
        System.out.println(num2==d);
        System.out.println(f.equals(a+b));
        System.out.println(f.equals(c+d));
        System.out.println(f.equals(num1+num2));
    }
}
